TextCt is a control driver that supports high-capacity (> 32K), fully-functional text-editing controls. These text editing controls (or "editors") are typically used to view and edit text files and/or to support interactive text I/O. The number of editor controls, and the amount of text in each editor, is limited only by available heap memory.
Setup
For proper operation, the TextCt controls should be of type Editable, Return keys should be accepted, and Idle, Heap, and Save messages should be sent to the control. The TextCt controls look best with solid bodies, 0 or 1-pixel frames, and no indent.
TextCt controls must also be linked to a TREC resource that is used to save program-specific editor settings. This TREC should be part of your program file or other res file used only by your program. To create a new TREC, simply copy and renumber one of the TRECs found in the tcDemoXY example program resource file. Multiple editors can share the same TREC, but the saved settings will then be the same for all editors linked to that TREC.
An STR resource with the same ID number as the TREC should also be added to your program file or other res file used only by your program. This STR is used to store the printing header associated with the TextCt control. Again, new STR resources can be formed by copying those found in the tcDemoXY program's resource file.
Options
The "Keys Accepted" options in the Control dialog can be used to modify how the Tab, Enter, Return, and Command keys are used in a window that contains a TextCt editor. If Tab is checked, then Tab keys will be sent to the editor (when it is selected) instead of being used to tab to the next editable item. If Enter or Return is checked, then the Enter or Return key will be sent to the editor (when it is selected) instead of being used to hit the default button. The behavior of the Enter and Return keys can be further modified by setting options in the "Editor Setup" dialog.
If the Command option is checked, then all command key combinations that do not correspond to menu items are sent to the editor (when it is selected), which then sends these back to the program as messages. The message returned will have uMsgType = ModuleMsg, uMsgID = 1550, uMsgItem = 1001, and uResult = ASCII value of key pressed.
The control's VarCode can also be used to modify control behavior. If 4 is added to VarCode, then the window title will be set equal to the name of the file in the editor at all times. If this is not done, then the file name is added to the window title (as "window name {file name}") whenever the control becomes selected. The latter approach works best when more than one TextCt control is in a window, and the former when only one TextCt control is present.
If 8 is added to VarCode, then the editor will be "read only", and the user will not be able to modify its contents. All direct commands, however, continue to work with such editors so that your program can directly modify the text in read only editors.
If 256 is added to VarCode, then TextCt's management of the window's title is completely disabled. This is useful when using TextCt to display part of a larger document that is managed by program code (see "Complex Documents" in the "Miscellaneous" topic).
Standard Items
TextCt supports the shared standard items Open, Save, Save As, Save Special (Save Selection), Revert, Page Setup,Print,Print Special(Print Selection), Cut, Copy, Copy Special (Copy As Table), Paste, Clear, Select All, Find (Search For), & Next Case. In addition to these, it supports several of its own standard items which can be placed in any menu:
Editor Setup...#1551 -- opens Editor Setup dialog
Tabs-To-Spaces#1554 -- converts tabs to spaces
6 Point#1555 -- resets editor font size to 6 Point
9 Point#1556 -- resets editor font size to 9 Point
12 Point#1557 -- resets editor font size to 12 Point
Style & Color
TextCt editors display a single, mono-spaced font which facilitates column-oriented operations. The font size can be changed by the user to 6, 9, or 12 pt. via the standard items described above, or by the program via the StlCtl command. Colors can also be changed by the program via the ClrCtl command. TextCt does not, however, support the FSSC menus (so don't set the "Uses FSSC" option in the Control dialog).
Limitations
TextCt editor controls are not word processors. They do not support auto-wrap and currently display only the Monaco font. They were designed to support high-speed, high-capacity ASCII text manipulation. If you have a need to support multi-styled text editing with auto-wrap, try the StylCt module included with the DynaEdit product.
No support for hand scrolling. The global hilite color is always used whether that option is checked or not. No support for data linking.